<template>
  <div style="padding: 10px">
    <d-select virtualized :options="groupOptions" v-model="groupValue" filterable></d-select>
    <p>groupValue 值：{{ groupValue }}</p>
  </div>
</template>

<script setup lang="ts">
  import { ref } from 'vue'
  // 分组
  const groupValue = ref('')
  const groupOptions = Array.from({ length: 10 }).map((_, idx) => {
    const label = idx + 1
    return {
      value: `分组 ${label}`,
      label: `分组 ${label}`,
      options: Array.from({ length: 10 }).map((_, idx) => ({
        value: `${idx + 1 + 10 * label}`,
        label: `选项 ${[idx % 10]}${idx + 1 + 10 * label}`
      }))
    }
  })
</script>

<style scoped></style>
